package edu.utwente.sem.hrs.model;

public class GastRol extends PersoonRol
{
  private String creditcardnummer;
  private Rekening rekening;
  
  public GastRol()
  {
    super();
    this.rekening = new Rekening();
  }

  public GastRol(String creditcardnummer)
  {
    this.creditcardnummer = creditcardnummer;
  }

  public Rekening getRekening()
  {
    return rekening;
  }

  @Override
  public boolean equals(Object obj)
  {
    boolean x = true;
    if (obj instanceof GastRol)
    {
      GastRol g = (GastRol) obj;
      if (!g.getCreditcardnummer().equals(creditcardnummer))
        x = false;
      else if (!g.getPersoon().getNaam().equals(this.getPersoon().getNaam()))
        x = false;
    }
    else
      x = false;
    return x;
  }

  public String getCreditcardnummer()
  {
    return creditcardnummer;
  }

  @Override
  public int hashCode()
  {
    return creditcardnummer.hashCode();
  }

  public void setCreditcardnummer(String creditcardnummer)
  {
    this.creditcardnummer = creditcardnummer;
  }

  @Override
  public String toString()
  {
    String s = "GastRol [";
    s += "creditcardnummer: " + creditcardnummer;
    s += "]";
    return s;
  }

}
